import { defineAsyncComponent } from "vue";

const files = import.meta.glob("./components/*/*Widget.vue");

const components = {};
for (const path in files) {
  const componentName = path
    .replace(/\.\/([^\/]+\/)+/, "")
    .replace(/\.\w+$/, "");
  components[componentName] = defineAsyncComponent(files[path]);
}

export default components;
